package dnl.dtools.grm;

import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;

public interface ResourceHandler {

	public InputStream getInputStream(URL url);

	public OutputStream getOutputStream(URL url);

	public void mkDir(Resource dir);

	public void mkDirs(Resource dir);

	/**
	 * Deletes the given resource.
	 * 
	 * @param resource
	 *            a <code>Resource</code> to delete.
	 */
	public void delete(Resource resource);

	/**
	 * Renames the given resource.
	 * 
	 * @param resource
	 *            a <code>Resource</code> to rename.
	 */
	public void rename(Resource dir);

	/**
	 * 
	 * @param resource
	 * @return
	 */
	public Resource getParent(Resource resource);

	/**
	 * Lists the resources in the given location
	 * 
	 * @param location
	 *            a <code>Resource</code> identifying the location to list.
	 * @return
	 */
	public Resource[] list(Resource location);
}
